import Vue from 'vue'
import Vuex from 'vuex'
import saveInLocal from './pulgin/saveInLocal'

Vue.use(Vuex)

//创建一个store仓库
const store = new Vuex.Store({
    //state用来存放数据的对象
    state: {
        // //初始值、存放的东西
        // title: '商城'
        menuListChild: [],
    },
    //定义取数据用来操作修改state的
    getters: {
        menuListChild: state => state.menuListChild,
    },
    //存数据
    mutations: {
        SET_MENULISTCHILD: (state, params) => {
            state.menuListChild = params
        },
    },
    plugins: [saveInLocal]
})

export default store;